﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Jumpton.Data;
using Jumpton.SFA.Server.Entity;
using Jumpton.Persistent;
namespace Jumpton.SFA.Server.BusinessRule.System
{
    public class ModulesManager:BusinessLogic
    {
        public bool Save(MODULES modules)
        {
            try
            {
                //事务
                modules.Connection.BeginTransaction(null);
                modules.Save();
                modules.Connection.CommitTransaction();

                return true;
            }
            catch (Exception ex)
            {
                modules.Connection.RollbackTransaction();
                this.message = ex.Message;
                throw ex;
            }
        }

        public bool SaveItems(MODULE_ITEMS items)
        {
            bool success = false;
            if (items != null)
            {
                try
                {
                    items.Save();
                    success = true;
                }
                catch (Exception error)
                {
                    throw new Exception(error.Message);
                }
            }
            return success;
        }
    }
}
